<?php


/**
 * Base class that represents a query for the 'kpi' table.
 *
 *
 *
 * @method EmpevalKpiQuery orderById($order = Criteria::ASC) Order by the id column
 * @method EmpevalKpiQuery orderByBonusGoalsFormId($order = Criteria::ASC) Order by the bonus_goals_form_id column
 * @method EmpevalKpiQuery orderByBonusGoalDesc($order = Criteria::ASC) Order by the bonus_goal_desc column
 * @method EmpevalKpiQuery orderByDescOfIndicator($order = Criteria::ASC) Order by the desc_of_indicator column
 * @method EmpevalKpiQuery orderByTrend($order = Criteria::ASC) Order by the trend column
 * @method EmpevalKpiQuery orderByIndicatorId($order = Criteria::ASC) Order by the indicator_id column
 * @method EmpevalKpiQuery orderByWeight($order = Criteria::ASC) Order by the weight column
 * @method EmpevalKpiQuery orderByRealization80($order = Criteria::ASC) Order by the realization_80 column
 * @method EmpevalKpiQuery orderByRealization100($order = Criteria::ASC) Order by the realization_100 column
 * @method EmpevalKpiQuery orderByMonitoring($order = Criteria::ASC) Order by the monitoring column
 * @method EmpevalKpiQuery orderBySelfAppraisal($order = Criteria::ASC) Order by the self_appraisal column
 * @method EmpevalKpiQuery orderByResultAchieved($order = Criteria::ASC) Order by the result_achieved column
 * @method EmpevalKpiQuery orderByResult($order = Criteria::ASC) Order by the result column
 * @method EmpevalKpiQuery orderByWeightResult($order = Criteria::ASC) Order by the weight_result column
 * @method EmpevalKpiQuery orderByComment($order = Criteria::ASC) Order by the comment column
 * @method EmpevalKpiQuery orderByStatus($order = Criteria::ASC) Order by the status column
 * @method EmpevalKpiQuery orderByLastModified($order = Criteria::ASC) Order by the last_modified column
 * @method EmpevalKpiQuery orderByCreated($order = Criteria::ASC) Order by the created column
 *
 * @method EmpevalKpiQuery groupById() Group by the id column
 * @method EmpevalKpiQuery groupByBonusGoalsFormId() Group by the bonus_goals_form_id column
 * @method EmpevalKpiQuery groupByBonusGoalDesc() Group by the bonus_goal_desc column
 * @method EmpevalKpiQuery groupByDescOfIndicator() Group by the desc_of_indicator column
 * @method EmpevalKpiQuery groupByTrend() Group by the trend column
 * @method EmpevalKpiQuery groupByIndicatorId() Group by the indicator_id column
 * @method EmpevalKpiQuery groupByWeight() Group by the weight column
 * @method EmpevalKpiQuery groupByRealization80() Group by the realization_80 column
 * @method EmpevalKpiQuery groupByRealization100() Group by the realization_100 column
 * @method EmpevalKpiQuery groupByMonitoring() Group by the monitoring column
 * @method EmpevalKpiQuery groupBySelfAppraisal() Group by the self_appraisal column
 * @method EmpevalKpiQuery groupByResultAchieved() Group by the result_achieved column
 * @method EmpevalKpiQuery groupByResult() Group by the result column
 * @method EmpevalKpiQuery groupByWeightResult() Group by the weight_result column
 * @method EmpevalKpiQuery groupByComment() Group by the comment column
 * @method EmpevalKpiQuery groupByStatus() Group by the status column
 * @method EmpevalKpiQuery groupByLastModified() Group by the last_modified column
 * @method EmpevalKpiQuery groupByCreated() Group by the created column
 *
 * @method EmpevalKpiQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
 * @method EmpevalKpiQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
 * @method EmpevalKpiQuery innerJoin($relation) Adds a INNER JOIN clause to the query
 *
 * @method EmpevalKpiQuery leftJoinBonusGoalsForms($relationAlias = null) Adds a LEFT JOIN clause to the query using the BonusGoalsForms relation
 * @method EmpevalKpiQuery rightJoinBonusGoalsForms($relationAlias = null) Adds a RIGHT JOIN clause to the query using the BonusGoalsForms relation
 * @method EmpevalKpiQuery innerJoinBonusGoalsForms($relationAlias = null) Adds a INNER JOIN clause to the query using the BonusGoalsForms relation
 *
 * @method EmpevalKpiQuery leftJoinViewBgfWithSuperiorPositionId($relationAlias = null) Adds a LEFT JOIN clause to the query using the ViewBgfWithSuperiorPositionId relation
 * @method EmpevalKpiQuery rightJoinViewBgfWithSuperiorPositionId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ViewBgfWithSuperiorPositionId relation
 * @method EmpevalKpiQuery innerJoinViewBgfWithSuperiorPositionId($relationAlias = null) Adds a INNER JOIN clause to the query using the ViewBgfWithSuperiorPositionId relation
 *
 * @method EmpevalKpiQuery leftJoinViewBonusReport($relationAlias = null) Adds a LEFT JOIN clause to the query using the ViewBonusReport relation
 * @method EmpevalKpiQuery rightJoinViewBonusReport($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ViewBonusReport relation
 * @method EmpevalKpiQuery innerJoinViewBonusReport($relationAlias = null) Adds a INNER JOIN clause to the query using the ViewBonusReport relation
 *
 * @method EmpevalKpiQuery leftJoinIndicators($relationAlias = null) Adds a LEFT JOIN clause to the query using the Indicators relation
 * @method EmpevalKpiQuery rightJoinIndicators($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Indicators relation
 * @method EmpevalKpiQuery innerJoinIndicators($relationAlias = null) Adds a INNER JOIN clause to the query using the Indicators relation
 *
 * @method EmpevalKpi findOne(PropelPDO $con = null) Return the first EmpevalKpi matching the query
 * @method EmpevalKpi findOneOrCreate(PropelPDO $con = null) Return the first EmpevalKpi matching the query, or a new EmpevalKpi object populated from the query conditions when no match is found
 *
 * @method EmpevalKpi findOneById(int $id) Return the first EmpevalKpi filtered by the id column
 * @method EmpevalKpi findOneByBonusGoalsFormId(int $bonus_goals_form_id) Return the first EmpevalKpi filtered by the bonus_goals_form_id column
 * @method EmpevalKpi findOneByBonusGoalDesc(string $bonus_goal_desc) Return the first EmpevalKpi filtered by the bonus_goal_desc column
 * @method EmpevalKpi findOneByDescOfIndicator(string $desc_of_indicator) Return the first EmpevalKpi filtered by the desc_of_indicator column
 * @method EmpevalKpi findOneByTrend(string $trend) Return the first EmpevalKpi filtered by the trend column
 * @method EmpevalKpi findOneByIndicatorId(int $indicator_id) Return the first EmpevalKpi filtered by the indicator_id column
 * @method EmpevalKpi findOneByWeight(int $weight) Return the first EmpevalKpi filtered by the weight column
 * @method EmpevalKpi findOneByRealization80(string $realization_80) Return the first EmpevalKpi filtered by the realization_80 column
 * @method EmpevalKpi findOneByRealization100(string $realization_100) Return the first EmpevalKpi filtered by the realization_100 column
 * @method EmpevalKpi findOneByMonitoring(string $monitoring) Return the first EmpevalKpi filtered by the monitoring column
 * @method EmpevalKpi findOneBySelfAppraisal(string $self_appraisal) Return the first EmpevalKpi filtered by the self_appraisal column
 * @method EmpevalKpi findOneByResultAchieved(string $result_achieved) Return the first EmpevalKpi filtered by the result_achieved column
 * @method EmpevalKpi findOneByResult(string $result) Return the first EmpevalKpi filtered by the result column
 * @method EmpevalKpi findOneByWeightResult(string $weight_result) Return the first EmpevalKpi filtered by the weight_result column
 * @method EmpevalKpi findOneByComment(string $comment) Return the first EmpevalKpi filtered by the comment column
 * @method EmpevalKpi findOneByStatus(int $status) Return the first EmpevalKpi filtered by the status column
 * @method EmpevalKpi findOneByLastModified(string $last_modified) Return the first EmpevalKpi filtered by the last_modified column
 * @method EmpevalKpi findOneByCreated(string $created) Return the first EmpevalKpi filtered by the created column
 *
 * @method array findById(int $id) Return EmpevalKpi objects filtered by the id column
 * @method array findByBonusGoalsFormId(int $bonus_goals_form_id) Return EmpevalKpi objects filtered by the bonus_goals_form_id column
 * @method array findByBonusGoalDesc(string $bonus_goal_desc) Return EmpevalKpi objects filtered by the bonus_goal_desc column
 * @method array findByDescOfIndicator(string $desc_of_indicator) Return EmpevalKpi objects filtered by the desc_of_indicator column
 * @method array findByTrend(string $trend) Return EmpevalKpi objects filtered by the trend column
 * @method array findByIndicatorId(int $indicator_id) Return EmpevalKpi objects filtered by the indicator_id column
 * @method array findByWeight(int $weight) Return EmpevalKpi objects filtered by the weight column
 * @method array findByRealization80(string $realization_80) Return EmpevalKpi objects filtered by the realization_80 column
 * @method array findByRealization100(string $realization_100) Return EmpevalKpi objects filtered by the realization_100 column
 * @method array findByMonitoring(string $monitoring) Return EmpevalKpi objects filtered by the monitoring column
 * @method array findBySelfAppraisal(string $self_appraisal) Return EmpevalKpi objects filtered by the self_appraisal column
 * @method array findByResultAchieved(string $result_achieved) Return EmpevalKpi objects filtered by the result_achieved column
 * @method array findByResult(string $result) Return EmpevalKpi objects filtered by the result column
 * @method array findByWeightResult(string $weight_result) Return EmpevalKpi objects filtered by the weight_result column
 * @method array findByComment(string $comment) Return EmpevalKpi objects filtered by the comment column
 * @method array findByStatus(int $status) Return EmpevalKpi objects filtered by the status column
 * @method array findByLastModified(string $last_modified) Return EmpevalKpi objects filtered by the last_modified column
 * @method array findByCreated(string $created) Return EmpevalKpi objects filtered by the created column
 *
 * @package    propel.generator.empeval.om
 */
abstract class EmpevalBaseKpiQuery extends ModelCriteria
{
    /**
     * Initializes internal state of EmpevalBaseKpiQuery object.
     *
     * @param     string $dbName The dabase name
     * @param     string $modelName The phpName of a model, e.g. 'Book'
     * @param     string $modelAlias The alias for the model in this query, e.g. 'b'
     */
    public function __construct($dbName = 'vgp_empeval', $modelName = 'EmpevalKpi', $modelAlias = null)
    {
        parent::__construct($dbName, $modelName, $modelAlias);
    }

    /**
     * Returns a new EmpevalKpiQuery object.
     *
     * @param     string $modelAlias The alias of a model in the query
     * @param     EmpevalKpiQuery|Criteria $criteria Optional Criteria to build the query from
     *
     * @return EmpevalKpiQuery
     */
    public static function create($modelAlias = null, $criteria = null)
    {
        if ($criteria instanceof EmpevalKpiQuery) {
            return $criteria;
        }
        $query = new EmpevalKpiQuery();
        if (null !== $modelAlias) {
            $query->setModelAlias($modelAlias);
        }
        if ($criteria instanceof Criteria) {
            $query->mergeWith($criteria);
        }

        return $query;
    }

    /**
     * Find object by primary key.
     * Propel uses the instance pool to skip the database if the object exists.
     * Go fast if the query is untouched.
     *
     * <code>
     * $obj  = $c->findPk(12, $con);
     * </code>
     *
     * @param mixed $key Primary key to use for the query
     * @param     PropelPDO $con an optional connection object
     *
     * @return   EmpevalKpi|EmpevalKpi[]|mixed the result, formatted by the current formatter
     */
    public function findPk($key, $con = null)
    {
        if ($key === null) {
            return null;
        }
        if ((null !== ($obj = EmpevalKpiPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
            // the object is alredy in the instance pool
            return $obj;
        }
        if ($con === null) {
            $con = Propel::getConnection(EmpevalKpiPeer::DATABASE_NAME, Propel::CONNECTION_READ);
        }
        $this->basePreSelect($con);
        if ($this->formatter || $this->modelAlias || $this->with || $this->select
         || $this->selectColumns || $this->asColumns || $this->selectModifiers
         || $this->map || $this->having || $this->joins) {
            return $this->findPkComplex($key, $con);
        } else {
            return $this->findPkSimple($key, $con);
        }
    }

    /**
     * Find object by primary key using raw SQL to go fast.
     * Bypass doSelect() and the object formatter by using generated code.
     *
     * @param     mixed $key Primary key to use for the query
     * @param     PropelPDO $con A connection object
     *
     * @return   EmpevalKpi A model object, or null if the key is not found
     * @throws   PropelException
     */
    protected function findPkSimple($key, $con)
    {
        $sql = 'SELECT ID, BONUS_GOALS_FORM_ID, BONUS_GOAL_DESC, DESC_OF_INDICATOR, TREND, INDICATOR_ID, WEIGHT, REALIZATION_80, REALIZATION_100, MONITORING, SELF_APPRAISAL, RESULT_ACHIEVED, RESULT, WEIGHT_RESULT, COMMENT, STATUS, LAST_MODIFIED, CREATED FROM kpi WHERE ID = :p0';
        try {
            $stmt = $con->prepare($sql);
            $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
            $stmt->execute();
        } catch (Exception $e) {
            Propel::log($e->getMessage(), Propel::LOG_ERR);
            throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
        }
        $obj = null;
        if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
            $obj = new EmpevalKpi();
            $obj->hydrate($row);
            EmpevalKpiPeer::addInstanceToPool($obj, (string) $key);
        }
        $stmt->closeCursor();

        return $obj;
    }

    /**
     * Find object by primary key.
     *
     * @param     mixed $key Primary key to use for the query
     * @param     PropelPDO $con A connection object
     *
     * @return EmpevalKpi|EmpevalKpi[]|mixed the result, formatted by the current formatter
     */
    protected function findPkComplex($key, $con)
    {
        // As the query uses a PK condition, no limit(1) is necessary.
        $criteria = $this->isKeepQuery() ? clone $this : $this;
        $stmt = $criteria
            ->filterByPrimaryKey($key)
            ->doSelect($con);

        return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
    }

    /**
     * Find objects by primary key
     * <code>
     * $objs = $c->findPks(array(12, 56, 832), $con);
     * </code>
     * @param     array $keys Primary keys to use for the query
     * @param     PropelPDO $con an optional connection object
     *
     * @return PropelObjectCollection|EmpevalKpi[]|mixed the list of results, formatted by the current formatter
     */
    public function findPks($keys, $con = null)
    {
        if ($con === null) {
            $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
        }
        $this->basePreSelect($con);
        $criteria = $this->isKeepQuery() ? clone $this : $this;
        $stmt = $criteria
            ->filterByPrimaryKeys($keys)
            ->doSelect($con);

        return $criteria->getFormatter()->init($criteria)->format($stmt);
    }

    /**
     * Filter the query by primary key
     *
     * @param     mixed $key Primary key to use for the query
     *
     * @return EmpevalKpiQuery The current query, for fluid interface
     */
    public function filterByPrimaryKey($key)
    {

        return $this->addUsingAlias(EmpevalKpiPeer::ID, $key, Criteria::EQUAL);
    }

    /**
     * Filter the query by a list of primary keys
     *
     * @param     array $keys The list of primary key to use for the query
     *
     * @return EmpevalKpiQuery The current query, for fluid interface
     */
    public function filterByPrimaryKeys($keys)
    {

        return $this->addUsingAlias(EmpevalKpiPeer::ID, $keys, Criteria::IN);
    }

    /**
     * Filter the query on the id column
     *
     * Example usage:
     * <code>
     * $query->filterById(1234); // WHERE id = 1234
     * $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
     * $query->filterById(array('min' => 12)); // WHERE id > 12
     * </code>
     *
     * @param     mixed $id The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalKpiQuery The current query, for fluid interface
     */
    public function filterById($id = null, $comparison = null)
    {
        if (is_array($id) && null === $comparison) {
            $comparison = Criteria::IN;
        }

        return $this->addUsingAlias(EmpevalKpiPeer::ID, $id, $comparison);
    }

    /**
     * Filter the query on the bonus_goals_form_id column
     *
     * Example usage:
     * <code>
     * $query->filterByBonusGoalsFormId(1234); // WHERE bonus_goals_form_id = 1234
     * $query->filterByBonusGoalsFormId(array(12, 34)); // WHERE bonus_goals_form_id IN (12, 34)
     * $query->filterByBonusGoalsFormId(array('min' => 12)); // WHERE bonus_goals_form_id > 12
     * </code>
     *
     * @see       filterByBonusGoalsForms()
     *
     * @see       filterByViewBgfWithSuperiorPositionId()
     *
     * @see       filterByViewBonusReport()
     *
     * @param     mixed $bonusGoalsFormId The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalKpiQuery The current query, for fluid interface
     */
    public function filterByBonusGoalsFormId($bonusGoalsFormId = null, $comparison = null)
    {
        if (is_array($bonusGoalsFormId)) {
            $useMinMax = false;
            if (isset($bonusGoalsFormId['min'])) {
                $this->addUsingAlias(EmpevalKpiPeer::BONUS_GOALS_FORM_ID, $bonusGoalsFormId['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($bonusGoalsFormId['max'])) {
                $this->addUsingAlias(EmpevalKpiPeer::BONUS_GOALS_FORM_ID, $bonusGoalsFormId['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalKpiPeer::BONUS_GOALS_FORM_ID, $bonusGoalsFormId, $comparison);
    }

    /**
     * Filter the query on the bonus_goal_desc column
     *
     * Example usage:
     * <code>
     * $query->filterByBonusGoalDesc('fooValue');   // WHERE bonus_goal_desc = 'fooValue'
     * $query->filterByBonusGoalDesc('%fooValue%'); // WHERE bonus_goal_desc LIKE '%fooValue%'
     * </code>
     *
     * @param     string $bonusGoalDesc The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalKpiQuery The current query, for fluid interface
     */
    public function filterByBonusGoalDesc($bonusGoalDesc = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($bonusGoalDesc)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $bonusGoalDesc)) {
                $bonusGoalDesc = str_replace('*', '%', $bonusGoalDesc);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(EmpevalKpiPeer::BONUS_GOAL_DESC, $bonusGoalDesc, $comparison);
    }

    /**
     * Filter the query on the desc_of_indicator column
     *
     * Example usage:
     * <code>
     * $query->filterByDescOfIndicator('fooValue');   // WHERE desc_of_indicator = 'fooValue'
     * $query->filterByDescOfIndicator('%fooValue%'); // WHERE desc_of_indicator LIKE '%fooValue%'
     * </code>
     *
     * @param     string $descOfIndicator The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalKpiQuery The current query, for fluid interface
     */
    public function filterByDescOfIndicator($descOfIndicator = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($descOfIndicator)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $descOfIndicator)) {
                $descOfIndicator = str_replace('*', '%', $descOfIndicator);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(EmpevalKpiPeer::DESC_OF_INDICATOR, $descOfIndicator, $comparison);
    }

    /**
     * Filter the query on the trend column
     *
     * Example usage:
     * <code>
     * $query->filterByTrend('fooValue');   // WHERE trend = 'fooValue'
     * $query->filterByTrend('%fooValue%'); // WHERE trend LIKE '%fooValue%'
     * </code>
     *
     * @param     string $trend The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalKpiQuery The current query, for fluid interface
     */
    public function filterByTrend($trend = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($trend)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $trend)) {
                $trend = str_replace('*', '%', $trend);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(EmpevalKpiPeer::TREND, $trend, $comparison);
    }

    /**
     * Filter the query on the indicator_id column
     *
     * Example usage:
     * <code>
     * $query->filterByIndicatorId(1234); // WHERE indicator_id = 1234
     * $query->filterByIndicatorId(array(12, 34)); // WHERE indicator_id IN (12, 34)
     * $query->filterByIndicatorId(array('min' => 12)); // WHERE indicator_id > 12
     * </code>
     *
     * @see       filterByIndicators()
     *
     * @param     mixed $indicatorId The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalKpiQuery The current query, for fluid interface
     */
    public function filterByIndicatorId($indicatorId = null, $comparison = null)
    {
        if (is_array($indicatorId)) {
            $useMinMax = false;
            if (isset($indicatorId['min'])) {
                $this->addUsingAlias(EmpevalKpiPeer::INDICATOR_ID, $indicatorId['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($indicatorId['max'])) {
                $this->addUsingAlias(EmpevalKpiPeer::INDICATOR_ID, $indicatorId['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalKpiPeer::INDICATOR_ID, $indicatorId, $comparison);
    }

    /**
     * Filter the query on the weight column
     *
     * Example usage:
     * <code>
     * $query->filterByWeight(1234); // WHERE weight = 1234
     * $query->filterByWeight(array(12, 34)); // WHERE weight IN (12, 34)
     * $query->filterByWeight(array('min' => 12)); // WHERE weight > 12
     * </code>
     *
     * @param     mixed $weight The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalKpiQuery The current query, for fluid interface
     */
    public function filterByWeight($weight = null, $comparison = null)
    {
        if (is_array($weight)) {
            $useMinMax = false;
            if (isset($weight['min'])) {
                $this->addUsingAlias(EmpevalKpiPeer::WEIGHT, $weight['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($weight['max'])) {
                $this->addUsingAlias(EmpevalKpiPeer::WEIGHT, $weight['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalKpiPeer::WEIGHT, $weight, $comparison);
    }

    /**
     * Filter the query on the realization_80 column
     *
     * Example usage:
     * <code>
     * $query->filterByRealization80('fooValue');   // WHERE realization_80 = 'fooValue'
     * $query->filterByRealization80('%fooValue%'); // WHERE realization_80 LIKE '%fooValue%'
     * </code>
     *
     * @param     string $realization80 The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalKpiQuery The current query, for fluid interface
     */
    public function filterByRealization80($realization80 = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($realization80)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $realization80)) {
                $realization80 = str_replace('*', '%', $realization80);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(EmpevalKpiPeer::REALIZATION_80, $realization80, $comparison);
    }

    /**
     * Filter the query on the realization_100 column
     *
     * Example usage:
     * <code>
     * $query->filterByRealization100('fooValue');   // WHERE realization_100 = 'fooValue'
     * $query->filterByRealization100('%fooValue%'); // WHERE realization_100 LIKE '%fooValue%'
     * </code>
     *
     * @param     string $realization100 The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalKpiQuery The current query, for fluid interface
     */
    public function filterByRealization100($realization100 = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($realization100)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $realization100)) {
                $realization100 = str_replace('*', '%', $realization100);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(EmpevalKpiPeer::REALIZATION_100, $realization100, $comparison);
    }

    /**
     * Filter the query on the monitoring column
     *
     * Example usage:
     * <code>
     * $query->filterByMonitoring('fooValue');   // WHERE monitoring = 'fooValue'
     * $query->filterByMonitoring('%fooValue%'); // WHERE monitoring LIKE '%fooValue%'
     * </code>
     *
     * @param     string $monitoring The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalKpiQuery The current query, for fluid interface
     */
    public function filterByMonitoring($monitoring = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($monitoring)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $monitoring)) {
                $monitoring = str_replace('*', '%', $monitoring);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(EmpevalKpiPeer::MONITORING, $monitoring, $comparison);
    }

    /**
     * Filter the query on the self_appraisal column
     *
     * Example usage:
     * <code>
     * $query->filterBySelfAppraisal('fooValue');   // WHERE self_appraisal = 'fooValue'
     * $query->filterBySelfAppraisal('%fooValue%'); // WHERE self_appraisal LIKE '%fooValue%'
     * </code>
     *
     * @param     string $selfAppraisal The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalKpiQuery The current query, for fluid interface
     */
    public function filterBySelfAppraisal($selfAppraisal = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($selfAppraisal)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $selfAppraisal)) {
                $selfAppraisal = str_replace('*', '%', $selfAppraisal);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(EmpevalKpiPeer::SELF_APPRAISAL, $selfAppraisal, $comparison);
    }

    /**
     * Filter the query on the result_achieved column
     *
     * Example usage:
     * <code>
     * $query->filterByResultAchieved('fooValue');   // WHERE result_achieved = 'fooValue'
     * $query->filterByResultAchieved('%fooValue%'); // WHERE result_achieved LIKE '%fooValue%'
     * </code>
     *
     * @param     string $resultAchieved The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalKpiQuery The current query, for fluid interface
     */
    public function filterByResultAchieved($resultAchieved = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($resultAchieved)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $resultAchieved)) {
                $resultAchieved = str_replace('*', '%', $resultAchieved);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(EmpevalKpiPeer::RESULT_ACHIEVED, $resultAchieved, $comparison);
    }

    /**
     * Filter the query on the result column
     *
     * Example usage:
     * <code>
     * $query->filterByResult(1234); // WHERE result = 1234
     * $query->filterByResult(array(12, 34)); // WHERE result IN (12, 34)
     * $query->filterByResult(array('min' => 12)); // WHERE result > 12
     * </code>
     *
     * @param     mixed $result The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalKpiQuery The current query, for fluid interface
     */
    public function filterByResult($result = null, $comparison = null)
    {
        if (is_array($result)) {
            $useMinMax = false;
            if (isset($result['min'])) {
                $this->addUsingAlias(EmpevalKpiPeer::RESULT, $result['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($result['max'])) {
                $this->addUsingAlias(EmpevalKpiPeer::RESULT, $result['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalKpiPeer::RESULT, $result, $comparison);
    }

    /**
     * Filter the query on the weight_result column
     *
     * Example usage:
     * <code>
     * $query->filterByWeightResult(1234); // WHERE weight_result = 1234
     * $query->filterByWeightResult(array(12, 34)); // WHERE weight_result IN (12, 34)
     * $query->filterByWeightResult(array('min' => 12)); // WHERE weight_result > 12
     * </code>
     *
     * @param     mixed $weightResult The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalKpiQuery The current query, for fluid interface
     */
    public function filterByWeightResult($weightResult = null, $comparison = null)
    {
        if (is_array($weightResult)) {
            $useMinMax = false;
            if (isset($weightResult['min'])) {
                $this->addUsingAlias(EmpevalKpiPeer::WEIGHT_RESULT, $weightResult['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($weightResult['max'])) {
                $this->addUsingAlias(EmpevalKpiPeer::WEIGHT_RESULT, $weightResult['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalKpiPeer::WEIGHT_RESULT, $weightResult, $comparison);
    }

    /**
     * Filter the query on the comment column
     *
     * Example usage:
     * <code>
     * $query->filterByComment('fooValue');   // WHERE comment = 'fooValue'
     * $query->filterByComment('%fooValue%'); // WHERE comment LIKE '%fooValue%'
     * </code>
     *
     * @param     string $comment The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalKpiQuery The current query, for fluid interface
     */
    public function filterByComment($comment = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($comment)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $comment)) {
                $comment = str_replace('*', '%', $comment);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(EmpevalKpiPeer::COMMENT, $comment, $comparison);
    }

    /**
     * Filter the query on the status column
     *
     * Example usage:
     * <code>
     * $query->filterByStatus(1234); // WHERE status = 1234
     * $query->filterByStatus(array(12, 34)); // WHERE status IN (12, 34)
     * $query->filterByStatus(array('min' => 12)); // WHERE status > 12
     * </code>
     *
     * @param     mixed $status The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalKpiQuery The current query, for fluid interface
     */
    public function filterByStatus($status = null, $comparison = null)
    {
        if (is_array($status)) {
            $useMinMax = false;
            if (isset($status['min'])) {
                $this->addUsingAlias(EmpevalKpiPeer::STATUS, $status['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($status['max'])) {
                $this->addUsingAlias(EmpevalKpiPeer::STATUS, $status['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalKpiPeer::STATUS, $status, $comparison);
    }

    /**
     * Filter the query on the last_modified column
     *
     * Example usage:
     * <code>
     * $query->filterByLastModified('2011-03-14'); // WHERE last_modified = '2011-03-14'
     * $query->filterByLastModified('now'); // WHERE last_modified = '2011-03-14'
     * $query->filterByLastModified(array('max' => 'yesterday')); // WHERE last_modified > '2011-03-13'
     * </code>
     *
     * @param     mixed $lastModified The value to use as filter.
     *              Values can be integers (unix timestamps), DateTime objects, or strings.
     *              Empty strings are treated as NULL.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalKpiQuery The current query, for fluid interface
     */
    public function filterByLastModified($lastModified = null, $comparison = null)
    {
        if (is_array($lastModified)) {
            $useMinMax = false;
            if (isset($lastModified['min'])) {
                $this->addUsingAlias(EmpevalKpiPeer::LAST_MODIFIED, $lastModified['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($lastModified['max'])) {
                $this->addUsingAlias(EmpevalKpiPeer::LAST_MODIFIED, $lastModified['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalKpiPeer::LAST_MODIFIED, $lastModified, $comparison);
    }

    /**
     * Filter the query on the created column
     *
     * Example usage:
     * <code>
     * $query->filterByCreated('2011-03-14'); // WHERE created = '2011-03-14'
     * $query->filterByCreated('now'); // WHERE created = '2011-03-14'
     * $query->filterByCreated(array('max' => 'yesterday')); // WHERE created > '2011-03-13'
     * </code>
     *
     * @param     mixed $created The value to use as filter.
     *              Values can be integers (unix timestamps), DateTime objects, or strings.
     *              Empty strings are treated as NULL.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalKpiQuery The current query, for fluid interface
     */
    public function filterByCreated($created = null, $comparison = null)
    {
        if (is_array($created)) {
            $useMinMax = false;
            if (isset($created['min'])) {
                $this->addUsingAlias(EmpevalKpiPeer::CREATED, $created['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($created['max'])) {
                $this->addUsingAlias(EmpevalKpiPeer::CREATED, $created['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalKpiPeer::CREATED, $created, $comparison);
    }

    /**
     * Filter the query by a related EmpevalBonusGoalsForms object
     *
     * @param   EmpevalBonusGoalsForms|PropelObjectCollection $bonusGoalsForms The related object(s) to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalKpiQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByBonusGoalsForms($bonusGoalsForms, $comparison = null)
    {
        if ($bonusGoalsForms instanceof EmpevalBonusGoalsForms) {
            return $this
                ->addUsingAlias(EmpevalKpiPeer::BONUS_GOALS_FORM_ID, $bonusGoalsForms->getId(), $comparison);
        } elseif ($bonusGoalsForms instanceof PropelObjectCollection) {
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }

            return $this
                ->addUsingAlias(EmpevalKpiPeer::BONUS_GOALS_FORM_ID, $bonusGoalsForms->toKeyValue('PrimaryKey', 'Id'), $comparison);
        } else {
            throw new PropelException('filterByBonusGoalsForms() only accepts arguments of type EmpevalBonusGoalsForms or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the BonusGoalsForms relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalKpiQuery The current query, for fluid interface
     */
    public function joinBonusGoalsForms($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('BonusGoalsForms');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'BonusGoalsForms');
        }

        return $this;
    }

    /**
     * Use the BonusGoalsForms relation BonusGoalsForms object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalBonusGoalsFormsQuery A secondary query class using the current class as primary query
     */
    public function useBonusGoalsFormsQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinBonusGoalsForms($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'BonusGoalsForms', 'EmpevalBonusGoalsFormsQuery');
    }

    /**
     * Filter the query by a related EmpevalViewBgfWithSuperiorPositionId object
     *
     * @param   EmpevalViewBgfWithSuperiorPositionId|PropelObjectCollection $viewBgfWithSuperiorPositionId The related object(s) to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalKpiQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByViewBgfWithSuperiorPositionId($viewBgfWithSuperiorPositionId, $comparison = null)
    {
        if ($viewBgfWithSuperiorPositionId instanceof EmpevalViewBgfWithSuperiorPositionId) {
            return $this
                ->addUsingAlias(EmpevalKpiPeer::BONUS_GOALS_FORM_ID, $viewBgfWithSuperiorPositionId->getId(), $comparison);
        } elseif ($viewBgfWithSuperiorPositionId instanceof PropelObjectCollection) {
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }

            return $this
                ->addUsingAlias(EmpevalKpiPeer::BONUS_GOALS_FORM_ID, $viewBgfWithSuperiorPositionId->toKeyValue('PrimaryKey', 'Id'), $comparison);
        } else {
            throw new PropelException('filterByViewBgfWithSuperiorPositionId() only accepts arguments of type EmpevalViewBgfWithSuperiorPositionId or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the ViewBgfWithSuperiorPositionId relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalKpiQuery The current query, for fluid interface
     */
    public function joinViewBgfWithSuperiorPositionId($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('ViewBgfWithSuperiorPositionId');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'ViewBgfWithSuperiorPositionId');
        }

        return $this;
    }

    /**
     * Use the ViewBgfWithSuperiorPositionId relation ViewBgfWithSuperiorPositionId object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalViewBgfWithSuperiorPositionIdQuery A secondary query class using the current class as primary query
     */
    public function useViewBgfWithSuperiorPositionIdQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinViewBgfWithSuperiorPositionId($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'ViewBgfWithSuperiorPositionId', 'EmpevalViewBgfWithSuperiorPositionIdQuery');
    }

    /**
     * Filter the query by a related EmpevalViewBonusReport object
     *
     * @param   EmpevalViewBonusReport|PropelObjectCollection $viewBonusReport The related object(s) to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalKpiQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByViewBonusReport($viewBonusReport, $comparison = null)
    {
        if ($viewBonusReport instanceof EmpevalViewBonusReport) {
            return $this
                ->addUsingAlias(EmpevalKpiPeer::BONUS_GOALS_FORM_ID, $viewBonusReport->getBonusGoalsFormId(), $comparison);
        } elseif ($viewBonusReport instanceof PropelObjectCollection) {
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }

            return $this
                ->addUsingAlias(EmpevalKpiPeer::BONUS_GOALS_FORM_ID, $viewBonusReport->toKeyValue('PrimaryKey', 'BonusGoalsFormId'), $comparison);
        } else {
            throw new PropelException('filterByViewBonusReport() only accepts arguments of type EmpevalViewBonusReport or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the ViewBonusReport relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalKpiQuery The current query, for fluid interface
     */
    public function joinViewBonusReport($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('ViewBonusReport');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'ViewBonusReport');
        }

        return $this;
    }

    /**
     * Use the ViewBonusReport relation ViewBonusReport object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalViewBonusReportQuery A secondary query class using the current class as primary query
     */
    public function useViewBonusReportQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinViewBonusReport($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'ViewBonusReport', 'EmpevalViewBonusReportQuery');
    }

    /**
     * Filter the query by a related EmpevalIndicators object
     *
     * @param   EmpevalIndicators|PropelObjectCollection $indicators The related object(s) to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalKpiQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByIndicators($indicators, $comparison = null)
    {
        if ($indicators instanceof EmpevalIndicators) {
            return $this
                ->addUsingAlias(EmpevalKpiPeer::INDICATOR_ID, $indicators->getId(), $comparison);
        } elseif ($indicators instanceof PropelObjectCollection) {
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }

            return $this
                ->addUsingAlias(EmpevalKpiPeer::INDICATOR_ID, $indicators->toKeyValue('PrimaryKey', 'Id'), $comparison);
        } else {
            throw new PropelException('filterByIndicators() only accepts arguments of type EmpevalIndicators or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the Indicators relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalKpiQuery The current query, for fluid interface
     */
    public function joinIndicators($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('Indicators');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'Indicators');
        }

        return $this;
    }

    /**
     * Use the Indicators relation Indicators object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalIndicatorsQuery A secondary query class using the current class as primary query
     */
    public function useIndicatorsQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        return $this
            ->joinIndicators($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'Indicators', 'EmpevalIndicatorsQuery');
    }

    /**
     * Exclude object from result
     *
     * @param   EmpevalKpi $kpi Object to remove from the list of results
     *
     * @return EmpevalKpiQuery The current query, for fluid interface
     */
    public function prune($kpi = null)
    {
        if ($kpi) {
            $this->addUsingAlias(EmpevalKpiPeer::ID, $kpi->getId(), Criteria::NOT_EQUAL);
        }

        return $this;
    }

}
